import { useDict } from '/@/hooks/dict';
const { yes_no_type } = useDict('yes_no_type'); //是否字典
const { app_project_type } = useDict('app_project_type'); //应用开发类型
const { industry_map } = useDict('industry_map'); //行业地图开发情况
const { terminal } = useDict('terminal'); //应用发布端
const { net_nesource } = useDict('net_nesource'); //网络资源类型
const { fund_resource } = useDict('fund_resource'); //资金来源
const { app_business_type } = useDict('app_business_type'); //应用类型
const { develop_type } = useDict('develop_type'); //开发模式
const { through_level } = useDict('through_level'); //贯通层级
const { user_range } = useDict('user_range'); //用户范围
const { protectionLevel_type } = useDict('protectionLevel_type'); //用户范围
const { cloud_type } = useDict('cloud_type'); //选择云资源类型
const { synergy_structure } = useDict('synergy_structure'); //业务协同结构
const { classification_type } = useDict('classification_type'); //数据资源格式分类
const { sql_type } = useDict('sql_type'); //数据资源格式类型
const { areas_type } = useDict('areas_type'); //功能领域
const { componentType_type } = useDict('componentType_type'); //组件类型
const { location_type } = useDict('location_type'); //部署位置
const { belong_domain } = useDict('belong_domain'); //所属领域

export default {
	isYN: (data) => {
		if (!data) {
			return;
		}
		let rea = '';
		yes_no_type.value.forEach((item) => {
			if (item.value == data) {
				rea = item.label;
			}
		});
		return rea;
	},
	jsonString: (data) => {
		if (!data) {
			return;
		}
		return JSON.stringify(data);
	},
	projectType: (data) => {
		if (!data) {
			return;
		}
		let rea = '';
		app_project_type.value.forEach((item) => {
			if (item.value == data) {
				rea = item.label;
			}
		});
		return rea;
	},
	//行业地图开发情况
	developStatus: (data) => {
		if (!data) {
			return;
		}
		let rea = '';
		industry_map.value.forEach((item) => {
			if (item.value == data) {
				rea = item.label;
			}
		});
		return rea;
	},
	//发布端
	terminal: (data) => {
		if (!data) {
			return;
		}
		let arr = data.split(',');
		let zhi = [];
		arr.forEach((item) => {
			terminal.value.forEach((it) => {
				if (it.value == item) {
					zhi.push(it.label);
				}
			});
		});
		return zhi.join(',');
	},
	//网络资源类型
	netResource: (data) => {
		if (!data) {
			return;
		}
		let arr = data.split(',');
		let zhi = [];
		arr.forEach((item) => {
			net_nesource.value.forEach((it) => {
				if (it.value == item) {
					zhi.push(it.label);
				}
			});
		});
		return zhi.join(',');
	},
	//没有用
	showNetResource: (data, ite) => {
		if (!data) {
			return;
		}
		if (data.indexOf(ite) >= 0) {
			return true;
		} else {
			return false;
		}
	},
	countyReportBase: (data) => {
		if (!data) {
			return;
		}
		let arr = data.split(',');
		let datas = ['', '党中央国务院决策部署', '市委市政府要求', '群众高频需求', '企业共性需求', '基层所盼', '先进地区改革创新经验'];
		let zhi = [];
		for (let i = 0; i < arr.length; i++) {
			zhi.push(datas[Number(arr[i])]);
		}
		return zhi.join(',');
	},
	// 资金来源
	fundResource: (data) => {
		if (!data) {
			return;
		}
		let arr = data.split(',');
		let zhi = [];
		arr.forEach((item) => {
			fund_resource.value.forEach((it) => {
				if (it.value == item) {
					zhi.push(it.label);
				}
			});
		});
		return zhi.join(',');
	},
	//应用类型
	irsType: (data) => {
		if (!data) {
			return;
		}
		let rea = '';
		app_business_type.value.forEach((item) => {
			if (item.value == data) {
				rea = item.label;
			}
		});
		return rea;
	},
	//开发模式
	developType: (data) => {
		if (!data) {
			return;
		}
		let arr = data.split(',');
		let zhi = [];
		arr.forEach((item) => {
			develop_type.value.forEach((it) => {
				if (it.value == item) {
					zhi.push(it.label);
				}
			});
		});
		return zhi.join(',');
	},
	//贯通层级
	throughLevel: (data) => {
		if (!data) {
			return;
		}
		let arr = data.split(',');

		let zhi = [];
		arr.forEach((item) => {
			through_level.value.forEach((it) => {
				if (it.value == item) {
					zhi.push(it.label);
				}
			});
		});
		return zhi.join(',');
	},
	//用户范围
	userRange: (data) => {
		if (!data) {
			return;
		}
		let arr = data.split(',');
		let zhi = [];
		arr.forEach((item) => {
			user_range.value.forEach((it) => {
				if (it.value == item) {
					zhi.push(it.label);
				}
			});
		});
		return zhi.join(',');
	},
	//等保级别
	protectionLevel: (data) => {
		if (!data) {
			return;
		}
		let rea = '';
		protectionLevel_type.value.forEach((item) => {
			if (item.value == data) {
				rea = item.label;
			}
		});
		return rea;
	},
	//选择云资源类型
	cloudType: (data) => {
		if (!data) {
			return;
		}
		let arr = data.split(',');
		let zhi = [];
		arr.forEach((item) => {
			cloud_type.value.forEach((it) => {
				if (it.value == item) {
					zhi.push(it.label);
				}
			});
		});
		return zhi.join(',');
	},
	//业务协同结构
	synergyStructure: (data) => {
		if (!data) {
			return;
		}
		let arr = data.split(',');
		let zhi = [];
		arr.forEach((item) => {
			synergy_structure.value.forEach((it) => {
				if (it.value == item) {
					zhi.push(it.label);
				}
			});
		});
		return zhi.join(',');
	},
	//秘评等级字典是等保级别的字典
	secretLevel: (data) => {
		if (!data) {
			return;
		}
		let rea = '';
		protectionLevel_type.value.forEach((item) => {
			if (item.value == data) {
				rea = item.label;
			}
		});
		return rea;
	},
	//数据资源格式分类
	classification: (data) => {
		if (!data) {
			return;
		}
		let rea = '';
		classification_type.value.forEach((item) => {
			if (item.value == data) {
				rea = item.label;
			}
		});
		return rea;
	},
	//功能领域
	areas: (data) => {
		if (!data) {
			return;
		}
		let rea = '';
		areas_type.value.forEach((item) => {
			if (item.value == data) {
				rea = item.label;
			}
		});
		return rea;
	},
	//组件类型
	componentType: (data) => {
		if (!data) {
			return;
		}
		let rea = '';
		componentType_type.value.forEach((item) => {
			if (item.value == data) {
				rea = item.label;
			}
		});
		return rea;
	},
	//部署位置
	location: (data) => {
		if (!data) {
			return;
		}
		let rea = '';
		location_type.value.forEach((item) => {
			if (item.value == data) {
				rea = item.label;
			}
		});
		return rea;
	},
	//所属领域
	businessArea: (data) => {
		if (!data) {
			return;
		}
		let rea = '';
		belong_domain.value.forEach((item) => {
			if (item.value == data) {
				rea = item.label;
			}
		});
		return rea;
	},
};
